//
//  ColorFactory.swift
//  AbstactFactoryDemo
//
//  Created by 好米有易 on 2017/9/28.
//  Copyright © 2017年 好米有易. All rights reserved.
//

import UIKit

/// 颜色工厂
public class ColorFactory: AbstractFactory {
    
    override public func getColor(type: ColorType) -> Color {
        
        if type == ColorType.red {
            
            return Red()
        }
        
        if type == ColorType.green {
            return Green()
            
        }
        
        if type == ColorType.blue {
            
            return Blue()
            
        }
        
        return super.getColor(type: type)
        
        
    }
    

    
}
